From: Glenn Morris Date: Fri, 24 Aug 2007 03:03:52 +0000 (+0000) Subject: (backup-buffer-copy): Revert 2007-08-22 change. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~421^2~16989 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=837300af6140993d4171e7bb2648c54a28a36d2d;p=emacs.git (backup-buffer-copy): Revert 2007-08-22 change. --- diff --git a/lisp/files.el b/lisp/files.el index 1cc46684d4b..614cad467ef 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3175,9 +3175,6 @@ BACKUPNAME is the backup file name, which is the old file renamed." (let ((umask (default-file-modes)) (dir (or (file-name-directory to-name) default-directory))) - ;; Can't delete or create files in a read-only directory. - (unless (file-writable-p dir) - (signal 'file-error (list "Directory is not writable" dir))) (unwind-protect (progn ;; Create temp files with strict access rights. It's easy to @@ -3186,11 +3183,6 @@ BACKUPNAME is the backup file name, which is the old file renamed." (set-default-file-modes ?\700) (while (condition-case () (progn - ;; If we allow for the possibility of something - ;; creating the file between delete and copy - ;; (below), we must also allow for the - ;; possibility of something deleting it between - ;; a file-exists-p check and a delete. (condition-case nil (delete-file to-name) (file-error nil)) @@ -3199,8 +3191,6 @@ BACKUPNAME is the backup file name, which is the old file renamed." (file-already-exists t)) ;; The file was somehow created by someone else between ;; `delete-file' and `copy-file', so let's try again. - ;; Does that every actually happen in practice? - ;; This is a potential infloop, which seems bad... ;; rms says "I think there is also a possible race ;; condition for making backup files" (emacs-devel 20070821). nil))